# -*- ecoding: utf-8 -*-
# @Author: Wick
# @Time: 2024-02-24 0:08

#分而治之
demo_list = [3, 3, 9, 6, 7, 10, 7, 6]

result = 0

for i in demo_list:
    result ^= i

print(result)

#拿到一个数，和其负数按位与，就可以得到最低为的值
split_flag = result&-result
print(split_flag)
# print(6&-6)
result1 = 0
result2 = 0
#分队，分成两堆
for i in demo_list:
    if i&split_flag:
        # print(f'堆1  {i}')
        result1 ^= i
    else:
        # print(f'堆2  {i}')
        result2 ^= i
print(f"出现一次的两个数分别是{result1}, {result2}")